package com.frank.minio.upload.model.dto;

import cn.hutool.core.bean.BeanUtil;
import com.frank.minio.upload.model.entity.SysUploadTask;
import io.minio.messages.Part;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Set;

@Data
@ToString
@Accessors(chain = true)
public class TaskRecordDTO extends SysUploadTask {

    /**
     * 已上传完的分片序列
     */
    private Set<Integer> exitParts;

    /**
     * 这个也仅仅是吧已上传的地址返回，具体使
     */
    private List<Part> exitPartList;

    public static TaskRecordDTO convertFromEntity(SysUploadTask task) {
        TaskRecordDTO dto = new TaskRecordDTO();
        BeanUtil.copyProperties(task, dto);
        return dto;
    }
}
